draftwise skills install: auto-detect harnesses on disk by default#59
Merged
draftwise skills install: auto-detect harnesses on disk by default#59
Conversation
Previously installed SKILL.md to all three known harnesses' user-level skill dirs (`~/.claude/skills/draftwise/`, `~/.cursor/skills/draftwise/`, `~/.gemini/skills/draftwise/`) regardless of whether the user actually had Claude Code, Cursor, or Gemini CLI installed. Now `detectInstalledProviders` (new export from `src/utils/skill-providers.js`) checks which of `~/.claude` / `~/.cursor` / `~/.gemini` exist at the chosen scope root and installs only to those — same shape impeccable's install uses (which delegates to the `vercel-labs/skills` package and auto-detects with `--all` as the explicit override). `--provider=all` is the explicit opt-in for the old "install everywhere" behavior; `--provider=<name>` still targets one harness regardless of detection. When auto-detect finds nothing the command errors with a hint pointing at both override flags. Install logs a one-line "Detected harness(es): …" so the user sees why a particular harness was picked when they didn't pass a flag. `skills help` gains two new lines — "Detected harnesses (user scope, --scope=user): …" and the project-scope equivalent — so the auto-detect set is visible without having to run install. `skills uninstall` is intentionally left alone. Its existing "iterate every known dir, skip ones with nothing to remove" behavior solves a different problem: cleaning up stale Draftwise installs whether or not the harness is still on disk. Detection-on-uninstall would miss the "user removed Cursor but the Draftwise dir lingers in `~/.cursor/skills/`" cleanup case. CLAUDE.md's "Standalone skill" section, the `src/utils/` line in the architecture overview, and README's slash-command callout updated to match. CHANGELOG `[Unreleased]` records the behavior change. 339/339 tests passing (up 5 from the baseline — three for `detectInstalledProviders`, one for the new install error path / detected-set log line, two for the new `skills help` detection lines).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
draftwise skills install(no--providerflag) now auto-detects which AI harnesses exist on the machine — checks~/.claude/~/.cursor/~/.geminiat the chosen scope root via the newdetectInstalledProvidersexport — and installs the standalone skill only to those. Same shape impeccable's install uses (which delegates to thevercel-labs/skillspackage and auto-detects with--allas the explicit override).--provider=allis the explicit opt-in for the old "install everywhere" behavior;--provider=<name>still targets one harness regardless of detection. When auto-detect finds nothing, the command errors with a hint pointing at both override flags. Install logs a one-line "Detected harness(es): …" so the user sees why a particular set was picked when they didn't pass a flag.skills helpgains two new lines that print the auto-detect set for each scope, so users can see whatinstall(no flag) would target without running it.skills uninstallis intentionally left alone. Its existing "iterate every known dir, skip empty" behavior cleans up stale Draftwise installs whether or not the harness is still on disk — detection-on-uninstall would miss that case.src/utils/architecture line, and README's slash-command callout all updated. CHANGELOG[Unreleased]records the behavior change.Test plan
npm test— 339 passing (up 5 from baseline: three fordetectInstalledProviders, one for the new install error path / detected-set log line, two for the newskills helpdetection lines).npm run lint— clean.node bin/draftwise.js skills install --helpshows the new default in the usage block.node bin/draftwise.js skills helpprints the new "Detected harnesses (user scope) / (project scope)" lines correctly on a machine with~/.claude,~/.cursor,~/.geminiall present.draftwise skills installshould install only to that one and logDetected harness(es): <label>.draftwise skills installshould error with the--provider=all/--provider=<name>hint instead of silently writing nothing.